Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Complement (complexity)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Complement_(complexity)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Complement_complexity rootpage-Complement_complexity skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Complement (complexity)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>In <a href="Computational_complexity_theory" title="Computational complexity theory">computational complexity theory</a>, the <b>complement</b> of a <a href="Decision_problem" title="Decision problem">decision problem</a> is the decision problem resulting from reversing the <i>yes</i> and <i>no</i> answers.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> Equivalently, if we define decision problems as sets of finite strings, then the <a href="Complement_(set_theory)" title="Complement (set theory)">complement</a> of this set over some fixed domain is its complement problem.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>For example, one important problem is whether a number is a <a href="Prime_number" title="Prime number">prime number</a>. Its complement is to determine whether a number is a <a href="Composite_number" title="Composite number">composite number</a> (a number which is not prime). Here the domain of the complement is the set of all integers exceeding one.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>There is a <a href="Turing_reduction" title="Turing reduction">Turing reduction</a> from every problem to its complement problem.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> The complement operation is an <a href="Involution_(mathematics)" title="Involution (mathematics)">involution</a>, meaning it "undoes itself", or the complement of the complement is the original problem.
</p><p>One can generalize this to the complement of a <a href="Complexity_class" title="Complexity class">complexity class</a>, called the <b>complement class</b>, which is the set of complements of every problem in the class.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> If a class is called <b>C</b>, its complement is conventionally labelled <b>co-C</b>. Notice that this is <i>not</i> the complement of the complexity class itself as a set of problems, which would contain a great deal more problems.
</p><p>A class is said to be <i>closed under complement</i> if the complement of any problem in the class is still in the class.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> Because there are Turing reductions from every problem to its complement, any class which is closed under Turing reductions is closed under complement. Any class which is closed under complement is equal to its complement class. However, under <a href="Many-one_reduction" title="Many-one reduction">many-one reductions</a>, many important classes, especially <a href="NP_(complexity)" title="NP (complexity)">NP</a>, are believed to be distinct from their complement classes (although this has not been proven).<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p>The <a href="Closure_(mathematics)" title="Closure (mathematics)">closure</a> of any complexity class under Turing reductions is a superset of that class which is closed under complement. The closure under complement is the smallest such class. If a class is intersected with its complement, we obtain a (possibly empty) subset which is closed under complement.
</p><p>Every deterministic complexity class (<b>DSPACE</b>(f(n)), <b>DTIME</b>(f(n)) for all f(n)) is closed under complement,<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> because one can simply add a last step to the algorithm which reverses the answer. This doesn't work for nondeterministic complexity classes, because if there exist both computation paths which accept and paths which reject, and all the paths reverse their answer, there will still be paths which accept and paths which reject — consequently, the machine accepts in both cases.
</p><p>Similarly, probabilistic classes such as <a href="BPP_(complexity)" title="BPP (complexity)">BPP</a>, <a href="ZPP_(complexity)" title="ZPP (complexity)">ZPP</a>, <a href="BQP" title="BQP">BQP</a> or <a href="PP_(complexity)" title="PP (complexity)">PP</a> which are defined symmetrically with regards to their <i>yes</i> and <i>no</i> instances are closed under complement. In contrast, classes such as <a href="RP_(complexity)" title="RP (complexity)">RP</a> and <b>co-RP</b> define their probabilities with one-sided error, and so are not (currently known to be) closed under complement.
</p><p>Some of the most surprising complexity results shown to date showed that the complexity classes <a href="NL_(complexity)" title="NL (complexity)">NL</a> and <a href="SL_(complexity)" title="SL (complexity)">SL</a> are in fact closed under complement, whereas before it was widely believed they were not (see <a href="Immerman%E2%80%93Szelepcs%C3%A9nyi_theorem" title="Immerman–Szelepcsényi theorem">Immerman–Szelepcsényi theorem</a>). The latter has become less surprising now that we know <b>SL</b> equals <b><a href="L_(complexity)" title="L (complexity)">L</a></b>, which is a deterministic class.
</p><p>Every class which is <a href="Low_(complexity)" title="Low (complexity)">low</a> for itself is closed under complement.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFItô1993" class="citation cs2">Itô, Kiyosi (1993), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=WHjO9K6xEm4C&amp;pg=PA269"><i>Encyclopedic Dictionary of Mathematics, Volume 1</i></a>, MIT Press, p.&nbsp;269, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780262590204</bdi></cite>.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFSchrijver1998" class="citation cs2">Schrijver, Alexander (1998), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=zEzW5mhppB8C&amp;pg=PA19"><i>Theory of Linear and Integer Programming</i></a>, Wiley Series in Discrete Mathematics &amp; Optimization, John Wiley &amp; Sons, p.&nbsp;19, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780471982326</bdi></cite>.</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFHomerSelman2011" class="citation cs2">Homer, Steven; <a href="Alan_Selman" title="Alan Selman">Selman, Alan L.</a> (2011), <i>Computability and Complexity Theory</i>, Texts in Computer Science, Springer, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781461406815</bdi></cite>.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFSingh2009" class="citation cs2">Singh, Arindama (2009), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=gqWMGR1otqoC&amp;pg=PA287"><i>Elements of Computation Theory</i></a>, Texts in Computer Science, Springer, Exercise 9.10, p.&nbsp;287, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781848824973</bdi></cite>.</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFBovetCrescenzi1994" class="citation cs2">Bovet, Daniele; Crescenzi, Pierluigi (1994), <i>Introduction to the Theory of Complexity</i>, Prentice Hall International Series in Computer Science, Prentice Hall, pp.&nbsp;<span class="nowrap">133–</span>134, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780139153808</bdi></cite>.</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFVollmer1999" class="citation cs2">Vollmer, Heribert (1999), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=55ZTgOJs8bsC&amp;pg=PA113"><i>Introduction to Circuit Complexity: A Uniform Approach</i></a>, Texts in Theoretical Computer Science. An EATCS Series, Springer, p.&nbsp;113, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9783540643104</bdi></cite>.</span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite id="CITEREFPruimWegener2005" class="citation cs2">Pruim, R.; Wegener, Ingo (2005), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=LXPVrcsdAyYC&amp;pg=PA66"><i>Complexity Theory: Exploring the Limits of Efficient Algorithms</i></a>, Springer, p.&nbsp;66, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9783540274773</bdi></cite>.</span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite id="CITEREFAusiello1999" class="citation cs2">Ausiello, Giorgio (1999), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=Yxxw90d9AuMC&amp;pg=PA189"><i>Complexity and Approximation: Combinatorial Optimization Problems and Their Approximability Properties</i></a>, Springer, p.&nbsp;189, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9783540654315</bdi></cite>.</span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2022-10-13" href="https://en.wikipedia.org/wiki/?title=Complement_(complexity)&amp;oldid=1115887219">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>